home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
PC Gamer (Italian) 30
/
PC Gamer IT CD 30 1-2.iso
/
ADDONS
/
P2EDIT
/
LINECONV.ZIP
/
LINECONV.CPP
next >
Wrap
C/C++ Source or Header
|
1998-02-04
|
839b
|
38 lines
/*
This is a short program to convert the value of edit /70 to the byte
location.
This source is copyright (c) Perspective Video & Electronics,
http://www.pvid.com
Permission granted to use, abuse, re-write, distribute, and delete
this code in any means you wish.
*/
#include <conio.h>
#include <stdio.h>
#include <iostream.h>
main()
{
unsigned long int lines, col, byteoffset;
int width;
printf("Note, the line width is the number you use after edit.\n");
printf("i.e. edit /70 filename.ext would be a width of 70\n\n");
printf("Line: ");
cin >> lines;
printf("COL : ");
cin >> col;
printf("Line width: ");
cin >> width;
byteoffset = lines * width + col - width - 1;
printf("Byte location: %ld\n", byteoffset);
return(0);
}